﻿using System;
using System.Web.Mvc;
using System.Web.Security;
using CodeCamp.BL;
using CodeCamp.BL.Model;

namespace CodeCamp.Web.Controllers
{
	/// <summary>
	/// Provides base implementation of a controller for the CodeCamp site
	/// </summary>
	public class CodeCampController : Controller
	{
		protected Guid GetUserID()
		{
			return (Guid)Membership.GetUser(User.Identity.Name).ProviderUserKey;
		}

		public ActionResult SessionInterest()
		{
			var data = CodeCampBL.SessoinInterest();
			return View("TagCloud", data);
		}

		public ActionResult TagUsage()
		{
			var data = CodeCampBL.TagUsage();
			return View("TagCloud", data);
		}

		public ViewResult AmbientView(dynamic data)
		{
			dynamic result = ModelExtension.LazyDecorate(this, data);
			return View(result);
		}

		public ViewResult AmbientView(string viewName, dynamic data)
		{
			dynamic result = ModelExtension.LazyDecorate(this, data);
			return View(viewName, result);
		}
	}
}